import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import '../assetc/css/base.css'
import Vant from 'vant'
import 'vant/lib/index.css'
import axios from 'axios'

Vue.use(Vant)
Vue.prototype.$axios = axios;
Vue.config.productionTip = false
axios.defaults.baseURL = 'http://157.122.54.189:9083'

// 
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    historyList: [],
    prodocts: '产品',
    prodoctPrice: 100,
    prodoctNum: 1
  },
  mutations: {
    clear(state, payload) {
      state.historyList = []
    },
    addHistory(state, payload) {
      if (state.historyList.indexOf(payload) === -1) {
        state.historyList.unshift(payload)
      }
    },
    recoveHistory(state, payload) {
      state.historyList = payload
    },
    addProduct(state) {
      state.prodoctNum++;
    }
  },
  getters: {
    totalPrice: state => {
      return state.prodoctPrice * state.prodoctNum
    }
  }
})

new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')


